package com.feicheng.service;

import com.feicheng.base.result.Result;
import com.feicheng.entity.PurchaseHeader;
import com.feicheng.entity.SaleOrderHeader;
import com.feicheng.model.SaleOrderHeaderUser;
import com.feicheng.model.SaleOrderHeaderWithSaleOrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("PROVIDERSALE")
public interface ProviderSaleController {
    /**
     * 新增销售订单接口
     * @param saleOrderHeaderWithSaleOrderItem    业务参数
     * @autor chunyu.zhao
     * @return
     */
    @PostMapping("/sale_order_header/info")
    Result insertSaleOrder(@RequestBody SaleOrderHeaderWithSaleOrderItem saleOrderHeaderWithSaleOrderItem);

    /**
     * 新增销售订单商品类型下拉框
     * @param
     * @author jiwei.sun
     * @return
     */
    @PostMapping("/product/sale_type/g")
    public Result selectType();

    /**
     *
     * @param current 当前页数
     * @param size    一页几条
     * @param saleOrderHeaderUser
     * @author  唐俊
     * @since 2022-07-05
     * @return
     */
    @PostMapping("/sale_order_header/page/g")
    public Result pageConditionSelect (
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size,
            @RequestBody SaleOrderHeaderUser saleOrderHeaderUser);


    /**
     * 获取所有商品名称下拉框
     * @param
     * @author xinyi.yang
     * @return
     */
    @PostMapping("/product/product_name")
    public Result getProductName(
            @RequestParam String type
    );

    /**
     * 销售订单详情顾客信息修改服务
     * @param saleOrderHeader 用于接取顾客信息主键和顾客主键的对象
     * @return
     * @author yiming.chang
     */
    @PutMapping("/sale_order_header/info")
    public Result updateCustomerInfo(
            @RequestBody SaleOrderHeader saleOrderHeader);

    /**
     * 销售订单用户详情页面
     * @param saleId (销售表主键)
     * @author shuoyu.qian
     * @return
     */

    /* 注入销售header的service */
    @PostMapping("/sale_order_header/sale_order/info")
    public Result selectSaleOrder(
            @RequestParam Integer saleId
    );

    /**
     * 销售详情页面
     * @param saleId (销售表主键)
     * @author shuoyu.qian
     * @return
     */
    @PostMapping("/sale-order-item/sale_order/info/g")
    public Result saleOrderItemPage(
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "4") Integer size,
            @RequestParam Integer saleId
    );

}

